﻿import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Layouts 1.2
import QtQuick.Controls.Styles 1.2
import QtQuick.Controls 2.12
import QtMultimedia 5.14
Rectangle{
    id: root
    //    title: "维护校正"
    width: parent.width
    height:  parent.height
    color: "white"
    radius: 12
    property var jcdata: CMaintenance.getDetectorInformation()
    onVisibleChanged: {
        jcdata=CMaintenance.getDetectorInformation()
    }
    Connections{
        target: CExeConfig
        onMaskingInformation:{
            jcdata=CMaintenance.getDetectorInformation()
        }
    }
    // 检测
    Rectangle{
        id: detection
        x:parent.width*0.1
        y:40*dp
        width: parent.width*0.8
        height: parent.height*0.75
        visible: true
        color: "white"
        CustomButton{
            title: "新建"
            visible: false
            y:20*dp
            x:parent.width/2+300*dp
            defaultMode1: true
            onReleased: {

            }
        }
        Row{
            y: 90*dp
            width: parent.width; height: 38*dp
            Text {
                width:parent.width*0.15
                horizontalAlignment: Text.AlignHCenter
                text: qsTr("序号")
                color: "#666666"
                font.pixelSize: config.fontsize
            }
            Text {
                width:parent.width*0.3
                horizontalAlignment: Text.AlignHCenter
                text: qsTr("模块")
                color: "#666666"
                font.pixelSize: config.fontsize
            }
            Text {
                width:parent.width*0.4
                horizontalAlignment: Text.AlignHCenter
                text: qsTr("检测信息")
                color: "#666666"
                font.pixelSize: config.fontsize
            }
            Text {
                width:parent.width*0.15
                horizontalAlignment: Text.AlignHCenter
                text: qsTr("是否屏蔽")
                color: "#666666"
                font.pixelSize: config.fontsize
            }
        }
        Rectangle{
            x:0*dp
            y:129*dp
            height: 2*dp
            width: parent.width
            color: "#DEDEDE"
        }
        ScrollView {
            x:0*dp
            y:132*dp
            width: parent.width
            height: parent.height-40*dp
            clip: true
            Column{
                id: myColumnLayout3
                width: detection.width
//                height: layout_failure.height
                spacing: 1*dp
                Repeater{
                    id:defmod3
                    model: jcdata
                    delegate: Item {
                        x:0*dp
                        width: detection.width
                        height: 60*dp
                        DefTab3COM{
                            width: parent.width
                            height: parent.height
                            xh:modelData.serial
                            jcdm:modelData.module
                            jcxx:modelData.info
                            ispbv:modelData.isBlocked==="是"
                            onRefre: {
                                jcdata=CMaintenance.getFaultInformation()
                            }
                        }
                    }
                }
            }
        }

    }

}
